<template>
	<div @click="reviewShow = false">
		<!-- xpert导航栏 -->
		<xpertNavBar :statusTab="statusTab" />
		<div style="height: 150px; width: 100%"></div>

		<div class="income">Income</div>
		<!-- incomeBox -->
		<div class="incomeBox f f-a-c">
			<div class="flexLef f f-d-c f-a-c f-j-c">
				<div class="date">Earnings to date</div>
				<div class="money">$ {{ obj.totalPrice }}</div>
			</div>
			<div class="flexLef f f-d-c f-a-c f-j-c">
				<div class="date">Avg. selling price</div>
				<div class="money">$ {{ obj.avgPrice }}</div>
			</div>
			<div class="flexLef f f-d-c f-a-c f-j-c">
				<div class="date">Order</div>
				<div class="money">{{ obj.totalCount }}</div>
			</div>
			<div class="flexLef f f-d-c f-a-c f-j-c">
				<div class="date">Earned this month</div>
				<div class="money">$ {{ obj.monthPrice }}</div>
			</div>
		</div>
		<!-- Overview -->
		<div class="overview m1280">
			<div class="over">Overview</div>
			<!-- tabs -->
			<div class="tabs">
				<Tabs :width="369" @changeTitle="changeTitle" :title="title" :tabList="tabList" />
			</div>
			<div class="date f f-a-c">Aug 9-15, 2023</div>
			<!-- 下拉 -->
			<div class="reviewss hand f f-a-c f-j-b">
				<div @click.stop="reviewShow = !reviewShow" class="rigFilter f f-a-c">Problem ${{ pricing }}<img src="/src/assets/user/1.png" class="filterImg" alt="" /></div>
				<div v-show="reviewShow" class="reviewsBox">
					<div v-for="(item, index) in sectList" :key="index" @click.stop="reviewCheck(item, index)" class="reviewsBoxitem f f-a-c">
						<div class="leftInp">
							<img src="/src/assets/user/3.png" v-if="item.show" class="inpImg" alt="" />
							<img src="/src/assets/user/4.png" v-else class="inpImg" alt="" />
						</div>
						<div class="rigCount">{{ item.targetedProblem }}</div>
					</div>
				</div>
			</div>
			<!-- EChact -->
			<div class="echact">
				<EChact ref="echat" />
			</div>
		</div>
		<!-- Reviews -->
		<div style="margin-bottom: 80px" class="reviews m1280">
			<div class="reviewsTit">Reviews</div>
			<div class="flexF f f-j-b">
				<div class="lefF">
					<div class="rougi">34 reviews</div>
					<div class="rate f f-a-c">
						<div v-for="(iteRou, indRou) in 5" :key="indRou">
							<img src="/src/assets/user/14.png" v-if="indRou < level" alt="" />
							<img src="/src/assets/user/15.png" v-else alt="" />
						</div>
					</div>
					<div class="rouNum">{{ Number(level).toFixed(1) }}</div>
				</div>
				<div class="rigR">
					<div class="jindu f f-a-c">
						<span :class="{ redColor: pro.value1 == 0 }">5 stars</span>
						<div class="progree">
							<a-progress :percent="pro.value1" strokeColor="#000" :show-info="false" />
						</div>
						<i :class="{ redColor: pro.value1 == 0 }">({{ pro.value1 / 100 }})</i>
					</div>
					<div class="jindu f f-a-c">
						<span :class="{ redColor: pro.value2 == 0 }">4 stars</span>
						<div class="progree">
							<a-progress :percent="pro.value2" strokeColor="#000" :show-info="false" />
						</div>
						<i :class="{ redColor: pro.value2 == 0 }">({{ pro.value2 / 100 }})</i>
					</div>
					<div class="jindu f f-a-c">
						<span :class="{ redColor: pro.value3 == 0 }">3 stars</span>
						<div class="progree">
							<a-progress :percent="pro.value3" strokeColor="#000" :show-info="false" />
						</div>
						<i :class="{ redColor: pro.value3 == 0 }">({{ pro.value3 / 100 }})</i>
					</div>
					<div class="jindu f f-a-c">
						<span :class="{ redColor: pro.value4 == 0 }">2 stars</span>
						<div class="progree">
							<a-progress :percent="pro.value4" strokeColor="#000" :show-info="false" />
						</div>
						<i :class="{ redColor: pro.value4 == 0 }">({{ pro.value4 / 100 }})</i>
					</div>
					<div class="jindu f f-a-c">
						<span :class="{ redColor: pro.value5 == 0 }">1 stars</span>
						<div class="progree">
							<a-progress :percent="pro.value5" strokeColor="#000" :show-info="false" />
						</div>
						<i :class="{ redColor: pro.value5 == 0 }">({{ pro.value5 / 100 }})</i>
					</div>
				</div>
			</div>
			<!-- xian -->
			<div class="xian"></div>
			<!-- 评论列表 -->
			<div class="commentList">
				<div v-for="(item, index) in viewList" :key="index" class="oneBox">
					<!-- 一级评论 -->
					<div class="oneBoxTop f">
						<div class="avaert"><img :src="item.avatar" alt="" /></div>
						<div class="avartCount">
							<div class="name">{{ item.title }}</div>
							<div class="stars f f-a-c">
								<div class="xingxing f f-a-c">
									<img v-for="(ite, ind) in item.score" :key="ind" src="/src/assets/user/14.png" class="xingImg" alt="" />
									<img v-for="(ite, ind) in 5 - item.score" :key="ind" src="/src/assets/user/15.png" class="xingImg" alt="" />
									{{ item.score }}.0
								</div>
								<div class="hengXian"></div>
								<div class="age">{{ getTimes(item.createTime) }}</div>
								<div class="genin">{{ item.firstName }}{{ item.lastName }}</div>
							</div>
							<div class="count">
								{{ item.content }}
							</div>
							<div v-if="myId != item.buyerUserId" @click="reports(item, 1)" class="icon hand f f-a-c"><img src="/src/assets/user/6.png" class="iconImg" alt="" /> <span>Report</span></div>
						</div>
					</div>
					<!-- 这个是二级评论 -->
					<div class="towBoxTop f f-a-c">
						<div class="leftTop"></div>
						<!-- 右边的评论 -->
						<div class="boxRig f">
							<div class="avacr"><img :src="item.sellerReviewRespVO?.avatar || ''" class="topImg" alt="" /></div>
							<div class="rigName">
								<div class="name">{{ item.sellerReviewRespVO?.title }}</div>
								<div class="count">{{ item.sellerReviewRespVO?.content }}</div>
								<!-- <div v-if="myId != item.sellerUserId" @click="reports(item, 2)" class="icon hand f f-a-c"><img src="/src/assets/user/6.png" class="iconImg" alt="" /> <span>Report</span></div> -->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<upLoad @reportObj="reportObj" ref="upLoads" />
		<xpertTabbar />
	</div>
</template>

<script setup>
	import { ref, onMounted } from "vue";
	import { LineChartView, OrderStatisticsXp, MyGigsList, OrderReviewStatisticsTotal, CreateUserOrder, OrderReviewList } from "@/api/xpert.js";
	import { ElMessage, dayjs } from "element-plus";
	import { getTimes } from "@/utils/setting.js";
	import { formatTimestamp } from "@/utils/setting.js";
	import xpertTabbar from "@/components/tabBar/xpertTabbar.vue";
	import xpertNavBar from "@/components/navBar/xpertNavBar.vue";
	import router from "@/router/index.js";
	import upLoad from "./upLoad.vue";
	import Tabs from "@/components/tabs/index.vue";
	import EChact from "@/components/eChact/index.vue";
	import ButtonDiffuse from "@/components/Button/ButtonDiffuse.vue";
	let statusTab = ref(1);
	let echat = ref("");
	let timeDangqian = ref(+new Date());
	let tab = ref(1);
	let qiTime = ref("2024/5/10");
	let moTime = ref(+new Date());
	let obj = ref({});
	let total = ref(0);
	let upLoads = ref("");
	let lists = ref([]);
	let pageNum = ref(1);
	let listClubl = ref([]);
	let price = ref(0);
	let pageSize = ref(100);
	let listPriX = ref([]);
	let articleIds = ref([]);
	let listPriY = ref([]);
	let listPri1 = ref([]);
	let listPri2 = ref([]);
	let type = ref("");
	let bindId = ref("");
	let pricing = ref(0);
	let reportId = ref("");
	let viewList = ref([]);
	let listPri3 = ref([]);
	let level = ref(0);
	let tabList = ref([
		{ color: "pink", name: "Week", id: "1" },
		{ color: "orange", name: "Month", id: "2" },
		{ color: "green", name: "6 Month", id: "3" },
		{ color: "red", name: "Year", id: "4" }
	]);
	let pro = ref({
		value1: 0,
		value2: 0,
		value3: 0,
		value4: 0,
		value5: 0
	});
	let sectList = ref([
		{
			show: false,
			targetedProblem: "Custom Gigs"
		},
		{
			show: false,
			targetedProblem: "Request Gigs"
		}
	]);

	let left = ref(0);
	let reviewShow = ref(false);
	let title = ref("Week");
	onMounted(async () => {
		await myGigsList();
		await OrderStatisticsList();
		await list();
		await MyPageViewLObj();
		await orderReviewListView();
		window.addEventListener("scroll", handleScroll);
	});
	// 点击举报
	const reports = (item, num) => {
		upLoads.value.upLoadVisible = true;
		if (num == 1) {
			reportId.value = item.buyerUserId;
		}
	};
	// 举报请求
	const reportObj = async obj => {
		let n = await CreateUserOrder({ foreignId: reportId.value, reportContent: obj.content, reportImages: obj.imgList });
		if (n.code == 200) {
			ElMessage.success(n.msg);
		}
		upLoads.value.upLoadVisible = false;
	};
	const myGigsList = async () => {
		let n = await MyGigsList();
		let m = n.data.map(item => {
			return {
				...item,
				show: false
			};
		});
		sectList.value = [...sectList.value, ...m];
	};
	// 用户评价列表
	const orderReviewListView = async () => {
		let n = await OrderReviewList({
			userId: JSON.parse(localStorage.getItem("logininfo")).userIdXp,
			pageNum: 1,
			pageSize: 4,
			title: ""
		});
		total.value = n.data.total;
		viewList.value = n.data.list;
		console.log(n, "898989898989898989898889");
	};
	// 获取用户信息
	const MyPageViewLObj = async () => {
		let n = await OrderReviewStatisticsTotal();
		level.value = n.data.level;
		n.data.reviewStatistics.forEach((item, index) => {
			if (item.score == 1) {
				pro.value[`value5`] = (item.total / n.data.reviewNum) * 100;
			} else if (item.score == 2) {
				pro.value[`value4`] = (item.total / n.data.reviewNum) * 100;
			} else if (item.score == 3) {
				pro.value[`value3`] = (item.total / n.data.reviewNum) * 100;
			} else if (item.score == 4) {
				pro.value[`value2`] = (item.total / n.data.reviewNum) * 100;
			} else if (item.score == 5) {
				pro.value[`value1`] = (item.total / n.data.reviewNum) * 100;
			}
		});
	};
	// 订单统计
	const OrderStatisticsList = async () => {
		let n = await OrderStatisticsXp();
		obj.value = n.data;
	};
	// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
	const list = async () => {
		let n = await LineChartView({
			startTime: 1683714523000,
			// tab.value == 1
			// 	? getTimestampOneWeekAgo() * 1000
			// 	: tab.value == 10
			// 	? getTimestampOneWeekAgoMoney() * 1000
			// 	: tab.value == 2
			// 	? getTimestampOneWeekAgoMoneyLiu() * 1000
			// 	: getTimestampOneWeekAgoMoneyLius() * 1000,
			timeType: tab.value == 10 ? 1 : tab.value == 3 ? 2 : tab.value,
			// bindId: 30,
			bindId: bindId.value,
			type: type.value
		});
		// 调用函数
		if (tab.value == 1) {
			let salesNum = 0;
			let completedNum = 0;
			let canceledmNum = 0;
			let m = generateWeeklyArray(n.data);
			console.log(m, "1111111111111111111111111111111111111");
			listPriX.value = m.map(item => item.name);
			listPri1.value = m.map(item => item.sales || 0);
			m.forEach(item => {
				salesNum += Number(item.sales) || 0;
				completedNum += Number(item.completed) || 0;
				canceledmNum += Number(item.canceledm) || 0;
			});
			echat.value.data = [`Sales $${salesNum}`, `Completed $${completedNum}`, `Canceled $${canceledmNum}`];
			listPri2.value = m.map(item => item.completed || 0);
			listPri3.value = m.map(item => item.canceledm || 0);
			echat.value.timList = listPriX.value;
			echat.value.dataList1 = listPri1.value;
			echat.value.dataList2 = listPri2.value;
			echat.value.dataList3 = listPri3.value;
			echat.value.echat();
			lists.value = m;
			qiTime.value = getTimestampOneWeekAgo() * 1000;
		} else if (tab.value == 10) {
			let salesNum = 0;
			let completedNum = 0;
			let canceledmNum = 0;
			// 一个月
			let m = generateMonthlyArrays(n.data);
			listPriX.value = m.map(item => dayjs(item.time).format("MM/DD"));
			listPri1.value = m.map(item => item.sales || 0);
			listPri2.value = m.map(item => item.completed || 0);
			listPri3.value = m.map(item => item.canceledm || 0);
			m.forEach(item => {
				salesNum += Number(item.sales) || 0;
				completedNum += Number(item.completed) || 0;
				canceledmNum += Number(item.canceledm) || 0;
			});
			echat.value.data = [`Sales $${salesNum}`, `Completed $${completedNum}`, `Canceled $${canceledmNum}`];
			echat.value.timList = listPriX.value;
			echat.value.dataList1 = listPri1.value;
			echat.value.dataList2 = listPri2.value;
			echat.value.dataList3 = listPri3.value;
			echat.value.echat();
			lists.value = m;
			qiTime.value = getTimestampOneWeekAgoMoney() * 1000;
			console.log(listPri1.value, listPri2.value, listPri3.value, "45545454545454545454");
		} else if (tab.value == 2) {
			let salesNum = 0;
			let completedNum = 0;
			let canceledmNum = 0;
			// 6月
			let m = liuyueArrFn(n.data);
			listPriX.value = m.map(item => item.name);
			listPri1.value = m.map(item => item.sales || 0);
			listPri2.value = m.map(item => item.completed || 0);
			listPri3.value = m.map(item => item.canceledm || 0);
			m.forEach(item => {
				salesNum += Number(item.sales) || 0;
				completedNum += Number(item.completed) || 0;
				canceledmNum += Number(item.canceledm) || 0;
			});
			echat.value.data = [`Sales $${salesNum}`, `Completed $${completedNum}`, `Canceled $${canceledmNum}`];
			echat.value.timList = listPriX.value;
			echat.value.dataList1 = listPri1.value;
			echat.value.dataList2 = listPri2.value;
			echat.value.dataList3 = listPri3.value;
			echat.value.echat();
			lists.value = m;
			qiTime.value = getTimestampOneWeekAgoMoneyLiu() * 1000;
		} else if (tab.value == 3) {
			let salesNum = 0;
			let completedNum = 0;
			let canceledmNum = 0;
			// 6月
			let m = liuyueArrFnYarn(n.data);
			listPriX.value = m.map(item => item.name);
			listPri1.value = m.map(item => item.sales || 0);
			listPri2.value = m.map(item => item.completed || 0);
			listPri3.value = m.map(item => item.canceledm || 0);
			m.forEach(item => {
				salesNum += Number(item.sales) || 0;
				completedNum += Number(item.completed) || 0;
				canceledmNum += Number(item.canceledm) || 0;
			});
			echat.value.data = [`Sales $${salesNum}`, `Completed $${completedNum}`, `Canceled $${canceledmNum}`];
			echat.value.timList = listPriX.value;
			echat.value.dataList1 = listPri1.value;
			echat.value.dataList2 = listPri2.value;
			echat.value.dataList3 = listPri3.value;
			echat.value.echat();
			lists.value = m;
			qiTime.value = getTimestampOneWeekAgoMoneyLius() * 1000;
		}
	};

	// generateWeeklyArray(dataArray);
	function generateWeeklyArray(dataArray) {
		var timestampArray = getOneWeekAgoDates(); // 使用之前提供的函数获取一周前的时间戳数组
		// console.log(timestampArray, "33333333333333333");
		var resultArray = [];
		for (var i = 0; i < timestampArray.length; i++) {
			var timestamp = timestampArray[i];
			var dayData = dataArray.find(function (item) {
				return item.time === getFormattedDate(timestamp);
			});

			var dayName = getDayName(timestamp);
			var sales = dayData ? dayData.sales : 0;
			var completed = dayData ? dayData.completed : 0;
			var canceledm = dayData ? dayData.canceledm : 0;

			resultArray.push({ name: dayName, sales: sales, completed: completed, canceledm: canceledm });
		}
		return resultArray;
	}
	// --------------------------------------------------------------------------------------------------------------------------------------------------
	// 给定的数组
	const liuyueArrFn = data => {
		// 生成从今天开始往前推六个月的数组
		const currentDate = new Date(); // 当前日期
		const sixMonthsAgo = new Date(currentDate.getFullYear(), currentDate.getMonth() - 6, 1); // 往前推六个月的日期
		const result = [];

		while (sixMonthsAgo <= currentDate) {
			const month = sixMonthsAgo.getMonth() + 1;
			const year = sixMonthsAgo.getFullYear();
			const monthName = getMonthName(month);

			// 在给定的数组中查找对应月份的数据
			const monthData = data.find(item => {
				const itemDate = new Date(item.time);
				return itemDate.getMonth() + 1 === month && itemDate.getFullYear() === year;
			});

			// 构造新的对象
			const newItem = {
				name: monthName,
				time: monthData ? monthData.time : null,
				sales: monthData ? monthData.sales : 0,
				completed: monthData ? monthData.completed : 0,
				canceledm: monthData ? monthData.canceledm : 0
			};

			result.push(newItem);

			// 前进到下一个月
			sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() + 1);
		}
		return result;
	};
	const liuyueArrFnYarn = data => {
		// 生成从今天开始往前推六个月的数组
		const currentDate = new Date(); // 当前日期
		const sixMonthsAgo = new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), 1); // 往前推六个月的日期
		const result = [];

		while (sixMonthsAgo <= currentDate) {
			const month = sixMonthsAgo.getMonth() + 1;
			const year = sixMonthsAgo.getFullYear();
			const monthName = getMonthName(month);

			// 在给定的数组中查找对应月份的数据
			const monthData = data.find(item => {
				const itemDate = new Date(item.time);
				return itemDate.getMonth() + 1 === month && itemDate.getFullYear() === year;
			});
			// 构造新的对象
			const newItem = {
				name: monthName,
				time: monthData ? monthData.time : null,
				sales: monthData ? monthData.sales : 0,
				canceledm: monthData ? monthData.canceledm : 0,
				completed: monthData ? monthData.completed : 0
			};

			result.push(newItem);

			// 前进到下一个月
			sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() + 1);
		}
		return result;
	};

	// 获取月份对应的名称
	function getMonthName(month) {
		const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
		return monthNames[month - 1];
	}
	// --------------------------------------------------------------------------------------------------------------------------------------------------
	// ==============================================================================================================
	function generateMonthlyArrays(dataArray) {
		var today = new Date(); // 当前日期
		var oneMonthAgo = new Date(today.getFullYear(), today.getMonth() - 1, today.getDate()); // 一个月前的日期
		var resultArray = [];

		while (oneMonthAgo <= today) {
			var formattedDate = getFormattedDates(oneMonthAgo);
			var dayData = dataArray.find(function (item) {
				return item.time === formattedDate;
			});

			var dayName = getDayNames(oneMonthAgo);
			var sales = dayData ? dayData.sales : 0;
			var completed = dayData ? dayData.completed : 0;
			var canceledm = dayData ? dayData.canceledm : 0;

			resultArray.push({ name: dayName, time: formattedDate, completed: completed, canceledm: canceledm, sales: sales });

			oneMonthAgo.setDate(oneMonthAgo.getDate() + 1); // 递增日期
		}
		console.log(resultArray, "000000000000000000000000000000000");
		return resultArray;
	}
	// 辅助函数：将日期对象转换为指定格式的日期字符串
	function getFormattedDates(date) {
		var year = date.getFullYear();
		var month = ("0" + (date.getMonth() + 1)).slice(-2);
		var day = ("0" + date.getDate()).slice(-2);
		return year + "-" + month + "-" + day;
	}
	// 辅助函数：根据日期获取对应的星期几名称
	function getDayNames(date) {
		var daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
		var dayOfWeek = daysOfWeek[date.getDay()];
		return dayOfWeek;
	}
	// ==============================================================================================================
	function getFormattedDate(timestamp) {
		var date = new Date(timestamp);
		var year = date.getFullYear();
		var month = ("0" + (date.getMonth() + 1)).slice(-2);
		var day = ("0" + date.getDate()).slice(-2);
		return year + "-" + month + "-" + day;
	}
	// 辅助函数：根据时间戳获取对应的星期几名称
	function getDayName(timestamp) {
		var daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
		var date = new Date(timestamp * 1000);
		var dayOfWeek = daysOfWeek[date.getDay()];
		return dayOfWeek;
	}
	function getOneWeekAgoDates() {
		var currentDate = new Date(); // 当前日期
		var oneWeekAgo = new Date(currentDate.getTime() - 7 * 24 * 60 * 60 * 1000); // 一周前的日期
		var dates = [];

		for (var i = 0; i < 7; i++) {
			var date = new Date(oneWeekAgo.getTime() + i * 24 * 60 * 60 * 1000);
			dates.push(date);
		}

		return dates;
	}
	//通过当前时间转为一周前的时间戳
	function getTimestampOneWeekAgo() {
		var now = new Date(); // 获取当前时间
		var oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000); // 计算一周前的时间
		let time = Math.floor(oneWeekAgo.getTime() / 1000); // 将时间戳转换为秒并返回
		// getTimestampArrayOneWeekAgo(time);
		return time; // 将时间戳转换为秒并返回
	}
	//通过当前时间转为一个月前的时间戳
	function getTimestampOneWeekAgoMoney() {
		var now = new Date(); // 获取当前时间
		var oneWeekAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000); // 计算一周前的时间
		let time = Math.floor(oneWeekAgo.getTime() / 1000); // 将时间戳转换为秒并返回
		// getTimestampArrayOneWeekAgo(time);
		return time; // 将时间戳转换为秒并返回
	}
	//通过当前时间转为6个月前的时间戳
	function getTimestampOneWeekAgoMoneyLiu() {
		var now = new Date(); // 获取当前时间
		var oneWeekAgo = new Date(now.getTime() - 180 * 24 * 60 * 60 * 1000); // 计算一周前的时间
		let time = Math.floor(oneWeekAgo.getTime() / 1000); // 将时间戳转换为秒并返回
		// getTimestampArrayOneWeekAgo(time);
		return time; // 将时间戳转换为秒并返回
	}
	//通过当前时间转为6个月前的时间戳
	function getTimestampOneWeekAgoMoneyLius() {
		var now = new Date(); // 获取当前时间
		var oneWeekAgo = new Date(now.getTime() - 365 * 24 * 60 * 60 * 1000); // 计算一周前的时间
		let time = Math.floor(oneWeekAgo.getTime() / 1000); // 将时间戳转换为秒并返回
		// getTimestampArrayOneWeekAgo(time);
		return time; // 将时间戳转换为秒并返回
	}
	//
	function getTimestampArrayOneWeekAgo(time) {
		var timestampArray = [];
		var oneDayMilliseconds = time; // 一天的毫秒数
		var now = new Date(); // 获取当前时间
		var daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
		for (var i = 0; i < 7; i++) {
			var timestamp = Math.floor((now.getTime() - i * oneDayMilliseconds) / 1000);
			var dayOfWeek = daysOfWeek[(now.getDay() - i + 7) % 7];
			timestampArray.push({ name: dayOfWeek });
		}
		console.log(timestampArray, "111111111111");
		return timestampArray;
	}
	// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////

	// const changeTitle = name => {
	// 	console.log(name, "77777777");
	// 	title.value = name;
	// };
	const changeTitle = name => {
		if (name == "Week") {
			tab.value = 1;
		} else if (name == "Month") {
			tab.value = 10;
		} else if (name == "6 Month") {
			tab.value = 2;
		} else {
			tab.value = 3;
		}
		// myCreateArt();
		list();
		title.value = name;
	};
	const change = (index, name, id) => {
		// this.nowPage = page;
		// title.value = "";
		setTimeout(() => {
			title.value = name;
		}, 200);
		left.value = index * 25 + "%";
	};
	// 选择
	const reviewCheck = (item, num) => {
		sectList.value.forEach(element => {
			element.show = false;
		});
		sectList.value[num].show = !sectList.value[num].show;
		reviewShow.value = false;
		if (num == 0) {
			// 1 自定义GIGS
			pricing.value = 0;
			type.value = 1;
		} else if (num == 1) {
			// 3 REQUEST订单
			pricing.value = 0;
			type.value = 3;
		} else {
			// 2 GIGS订单
			type.value = 2;
			bindId.value = item.id;
			pricing.value = item.pricing;
		}
		list();
	};
	// 这个是当头部导航栏滑倒下面时给tabr加个背景
	const handleScroll = () => {
		const scrollTop = document.documentElement.scrollTop;
		if (scrollTop > 0) {
			statusTab.value = 2;
		} else {
			statusTab.value = 1;
		}
	};
</script>
<style scoped>
	@import "./index.scss";
</style>
